More than 1,400 people who believe the scientific method is the best way to approach investment management, insurance, and related fields. Ideas backed up with information. And improved by iteration. That’s Two Sigma. Learn more at twosigma.com.
Citadel is a leading alternative investment management firm. For more than three decades, we’ve captured undiscovered market opportunities in markets around the world by empowering extraordinary people to pursue their best and boldest ideas. Our investors at Citadel include many of the world's preeminent public and private institutions. Each day, we reimagine and refine our investment strategies, models and technology in pursuit of market-leading investment returns.
The D. E. Shaw group is a global investment and technology development firm with offices in North America, Europe, and Asia.
Bridgewater Associates is a premier asset management firm, focused on delivering unique insight and partnership for the most sophisticated global institutional investors.
AQR is a global investment management firm built at the intersection of financial theory and practical application. We invest over $143 billion* on behalf of our clients − from pension funds, insurance companies, endowments and foundations to sovereign wealth funds and financial advisors. Our commitment to them is to strive to deliver superior, long-term results. We do this by filtering out market noise to identify and isolate what matters most, and by implementing ideas that stand up to rigorous testing.
# lets import libraries
from googleapiclient.discovery import build
import pandas as pd
import seaborn as sn
api_key = 'AIzaSyB24Kop04L1GlTgRCm1XtQ4KB2a4gaBOwA'
Two_Sigma_channel_id = ['UCOylzLjxDbZHFzDbHJiJhgw' # Two Sigma
]
youtube = build('youtube','v3',developerKey = api_key)
from googleapiclient.errors import HttpError
def get_channel_stats(youtube, Two_Sigma_channel_id):
all_data = []
try:
request = youtube.channels().list(
part='snippet,contentDetails,statistics',
id=','.join(Two_Sigma_channel_id)
)
response = request.execute()
for item in response.get('items', []):
snippet = item.get('snippet', {})
statistics = item.get('statistics', {})
data = {
'Channel_name': snippet.get('title', ''),
'Subscribers': statistics.get('subscriberCount', ''),
'Views': statistics.get('viewCount', ''),
'Total_videos': statistics.get('videoCount', '')
}
all_data.append(data)
except HttpError as e:
print(f"HTTP error occurred: {e}")
print(f"Request URL: {e.resp.request.url}")
print(f"Request body: {e.resp.request.body}")
return all_data
get_channel_stats(youtube,Two_Sigma_channel_id)
[{'Channel_name': 'Two Sigma', 'Subscribers': '4600', 'Views': '155594', 'Total_videos': '20'}]
channel_statistics = get_channel_stats(youtube, Two_Sigma_channel_id)
Two_Sigma_channel_data =pd.DataFrame(channel_statistics)
Two_Sigma_channel_data
Channel_name | Subscribers | Views | Total_videos | |
---|---|---|---|---|
0 | Two Sigma | 4600 | 155594 | 20 |
# Function to get channel statistics
api_key = 'AIzaSyB24Kop04L1GlTgRCm1XtQ4KB2a4gaBOwA'
Citadel_channel_id = ['UCXuLgCefm8zvvQwSx7A71aQ' # Citadel
]
youtube = build('youtube','v3',developerKey = api_key)
from googleapiclient.errors import HttpError
def get_channel_stats(youtube, Citadel_channel_id):
all_data = []
try:
request = youtube.channels().list(
part='snippet,contentDetails,statistics',
id=','.join(Citadel_channel_id)
)
response = request.execute()
for item in response.get('items', []):
snippet = item.get('snippet', {})
statistics = item.get('statistics', {})
data = {
'Channel_name': snippet.get('title', ''),
'Subscribers': statistics.get('subscriberCount', ''),
'Views': statistics.get('viewCount', ''),
'Total_videos': statistics.get('videoCount', '')
}
all_data.append(data)
except HttpError as e:
print(f"HTTP error occurred: {e}")
print(f"Request URL: {e.resp.request.url}")
print(f"Request body: {e.resp.request.body}")
return all_data
get_channel_stats(youtube, Citadel_channel_id)
[{'Channel_name': 'Citadel', 'Subscribers': '10800', 'Views': '1753072', 'Total_videos': '78'}]
channel_statistics = get_channel_stats(youtube, Citadel_channel_id)
Citadel_channel_data =pd.DataFrame(channel_statistics)
Citadel_channel_data
Channel_name | Subscribers | Views | Total_videos | |
---|---|---|---|---|
0 | Citadel | 10800 | 1753072 | 78 |
# Function to get channel statistics
api_key = 'AIzaSyB24Kop04L1GlTgRCm1XtQ4KB2a4gaBOwA'
The_D_E_Shaw_Group_channel_id = ['UCTapQuEwzIFwGNAphDrWjew' # The D. E. Shaw Group
]
youtube = build('youtube','v3',developerKey = api_key)
from googleapiclient.errors import HttpError
def get_channel_stats(youtube,The_D_E_Shaw_Group_channel_id):
all_data = []
try:
request = youtube.channels().list(
part='snippet,contentDetails,statistics',
id=','.join(The_D_E_Shaw_Group_channel_id)
)
response = request.execute()
for item in response.get('items', []):
snippet = item.get('snippet', {})
statistics = item.get('statistics', {})
data = {
'Channel_name': snippet.get('title', ''),
'Subscribers': statistics.get('subscriberCount', ''),
'Views': statistics.get('viewCount', ''),
'Total_videos': statistics.get('videoCount', '')
}
all_data.append(data)
except HttpError as e:
print(f"HTTP error occurred: {e}")
print(f"Request URL: {e.resp.request.url}")
print(f"Request body: {e.resp.request.body}")
return all_data
get_channel_stats(youtube,The_D_E_Shaw_Group_channel_id)
[{'Channel_name': 'The D. E. Shaw Group', 'Subscribers': '1550', 'Views': '100520', 'Total_videos': '36'}]
channel_statistics = get_channel_stats(youtube, The_D_E_Shaw_Group_channel_id)
The_D_E_Shaw_Group_channel_data =pd.DataFrame(channel_statistics)
The_D_E_Shaw_Group_channel_data
Channel_name | Subscribers | Views | Total_videos | |
---|---|---|---|---|
0 | The D. E. Shaw Group | 1550 | 100520 | 36 |
# Function to get channel statistics
api_key = 'AIzaSyB24Kop04L1GlTgRCm1XtQ4KB2a4gaBOwA'
Bridgewater_Associates_channel_id = ['UC-hKNOj4P-Y8hR9QEHpZPig' # Bridgewater Associates
]
youtube = build('youtube','v3',developerKey = api_key)
from googleapiclient.errors import HttpError
def get_channel_stats(youtube, Bridgewater_Associates_channel_id):
all_data = []
try:
request = youtube.channels().list(
part='snippet,contentDetails,statistics',
id=','.join(Bridgewater_Associates_channel_id)
)
response = request.execute()
for item in response.get('items', []):
snippet = item.get('snippet', {})
statistics = item.get('statistics', {})
data = {
'Channel_name': snippet.get('title', ''),
'Subscribers': statistics.get('subscriberCount', ''),
'Views': statistics.get('viewCount', ''),
'Total_videos': statistics.get('videoCount', '')
}
all_data.append(data)
except HttpError as e:
print(f"HTTP error occurred: {e}")
print(f"Request URL: {e.resp.request.url}")
print(f"Request body: {e.resp.request.body}")
return all_data
get_channel_stats(youtube,Bridgewater_Associates_channel_id)
[{'Channel_name': 'Bridgewater Associates', 'Subscribers': '111000', 'Views': '4437710', 'Total_videos': '90'}]
channel_statistics = get_channel_stats(youtube, Bridgewater_Associates_channel_id)
Bridgewater_Associates_channel_data =pd.DataFrame(channel_statistics)
Bridgewater_Associates_channel_data
Channel_name | Subscribers | Views | Total_videos | |
---|---|---|---|---|
0 | Bridgewater Associates | 111000 | 4437710 | 90 |
# Function to get channel statistics
api_key = 'AIzaSyB24Kop04L1GlTgRCm1XtQ4KB2a4gaBOwA'
AQR_Capital_Management_channel_id = ['UCb2C6udgxl9z_tWf0IFYK7g' # AQR Capital Management
]
youtube = build('youtube','v3',developerKey = api_key)
from googleapiclient.errors import HttpError
def get_channel_stats(youtube, AQR_Capital_Management_channel_id ):
all_data = []
try:
request = youtube.channels().list(
part='snippet,contentDetails,statistics',
id=','.join(AQR_Capital_Management_channel_id )
)
response = request.execute()
for item in response.get('items', []):
snippet = item.get('snippet', {})
statistics = item.get('statistics', {})
data = {
'Channel_name': snippet.get('title', ''),
'Subscribers': statistics.get('subscriberCount', ''),
'Views': statistics.get('viewCount', ''),
'Total_videos': statistics.get('videoCount', '')
}
all_data.append(data)
except HttpError as e:
print(f"HTTP error occurred: {e}")
print(f"Request URL: {e.resp.request.url}")
print(f"Request body: {e.resp.request.body}")
return all_data
get_channel_stats(youtube,AQR_Capital_Management_channel_id)
[{'Channel_name': 'AQR Capital Management', 'Subscribers': '978', 'Views': '40724', 'Total_videos': '10'}]
channel_statistics = get_channel_stats(youtube, AQR_Capital_Management_channel_id)
AQR_Capital_Management_channel_data =pd.DataFrame(channel_statistics)
AQR_Capital_Management_channel_data
Channel_name | Subscribers | Views | Total_videos | |
---|---|---|---|---|
0 | AQR Capital Management | 978 | 40724 | 10 |
# Lets combine the data frames
# Combine DataFrames using concat
combined_hedge_funds_channels_df = pd.concat([Two_Sigma_channel_data ,
Citadel_channel_data ,
The_D_E_Shaw_Group_channel_data ,
Bridgewater_Associates_channel_data,
AQR_Capital_Management_channel_data ,
], ignore_index=True)
# Display the result
print(combined_hedge_funds_channels_df)
Channel_name Subscribers Views Total_videos 0 Two Sigma 4600 155594 20 1 Citadel 10800 1753072 78 2 The D. E. Shaw Group 1550 100520 36 3 Bridgewater Associates 111000 4437710 90 4 AQR Capital Management 978 40724 10
# # lets have a look at the datatypes
combined_hedge_funds_channels_df.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 5 entries, 0 to 4 Data columns (total 4 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Channel_name 5 non-null object 1 Subscribers 5 non-null object 2 Views 5 non-null object 3 Total_videos 5 non-null object dtypes: object(4) memory usage: 292.0+ bytes
# lets change the datatypes to perform visualisations
combined_hedge_funds_channels_df['Subscribers'] = pd.to_numeric(combined_hedge_funds_channels_df['Subscribers'])
combined_hedge_funds_channels_df['Views'] = pd.to_numeric(combined_hedge_funds_channels_df['Views'])
combined_hedge_funds_channels_df['Total_videos'] = pd.to_numeric(combined_hedge_funds_channels_df['Total_videos'])
# letsconirm if the datatypes has changed
combined_hedge_funds_channels_df.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 5 entries, 0 to 4 Data columns (total 4 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Channel_name 5 non-null object 1 Subscribers 5 non-null int64 2 Views 5 non-null int64 3 Total_videos 5 non-null int64 dtypes: int64(3), object(1) memory usage: 292.0+ bytes
combined_hedge_funds_channels_df
Channel_name | Subscribers | Views | Total_videos | |
---|---|---|---|---|
0 | Two Sigma | 4600 | 155594 | 20 |
1 | Citadel | 10800 | 1753072 | 78 |
2 | The D. E. Shaw Group | 1550 | 100520 | 36 |
3 | Bridgewater Associates | 111000 | 4437710 | 90 |
4 | AQR Capital Management | 978 | 40724 | 10 |
import pandas as pd
import matplotlib.pyplot as plt
# Sort the DataFrame by 'Subscribers' in descending order
combined_hedge_funds_channels_df_subscribers_sorted = combined_hedge_funds_channels_df.sort_values(by='Subscribers', ascending=False)
# Shorten channel names
combined_hedge_funds_channels_df_subscribers_sorted['Channel_name'] = combined_hedge_funds_channels_df_subscribers_sorted['Channel_name'].apply(lambda x: x[:15])
# Plotting Subscribers in descending order
fig, axes = plt.subplots(nrows=3, ncols=1, figsize=(10, 15))
axes[0].bar(combined_hedge_funds_channels_df_subscribers_sorted['Channel_name'], combined_hedge_funds_channels_df_subscribers_sorted['Subscribers'], color='blue')
axes[0].set_title('Subscribers')
# Sort the DataFrame by 'Views' in descending order
combined_hedge_funds_channels_df_views_sorted = combined_hedge_funds_channels_df.sort_values(by='Views', ascending=False)
# Shorten channel names
combined_hedge_funds_channels_df_views_sorted['Channel_name'] = combined_hedge_funds_channels_df_views_sorted['Channel_name'].apply(lambda x: x[:15])
# Plotting Views in descending order
axes[1].bar(combined_hedge_funds_channels_df_views_sorted['Channel_name'],combined_hedge_funds_channels_df_views_sorted['Views'], color='brown')
axes[1].set_title('Views')
# Sort the DataFrame by 'Total_videos' in descending order
combined_hedge_funds_channels_df_total_videos_sorted =combined_hedge_funds_channels_df.sort_values(by='Total_videos', ascending=False)
# Shorten channel names
combined_hedge_funds_channels_df_total_videos_sorted['Channel_name'] = combined_hedge_funds_channels_df_total_videos_sorted['Channel_name'].apply(lambda x: x[:15])
# Plotting Total Videos in descending order
axes[2].bar(combined_hedge_funds_channels_df_total_videos_sorted['Channel_name'], combined_hedge_funds_channels_df_total_videos_sorted['Total_videos'], color='orange')
axes[2].set_title('Total Videos')
# Adjust layout for better visibility
plt.tight_layout()
# Show the plot
plt.show()